import request from "./request";

// 主页热映 最受好评电影
// index/topRatedMovies
export function getTopRateMovie() {
    return request({
        url: "index/topRatedMovies",
        method: "GET",
    });
}

// 主页热映列表
// index/movieOnInfoList
export function getHomeHotMovie() {
    return request({
        url: "index/movieOnInfoList",
        method: "GET",
    });
}

export function getManhua() {
    return request({
        url: "ComicDetail?comic_id=31033",
        method: "GET",
    });
}

export function getcity() {
    //根据经纬度获取当前城市地址
    return request({
        url: "city/latlng?lat=23.53919&lng=110.39215",
        method: "GET",
    });
}

// 待映 最近最受期待列表
export function getmostExpected() {
    return request({
        url: "index/mostExpected",
        method: "GET",
    });
}

//待映列表
export function getcomingList() {
    return request({
        url: "index/comingList",
        method: "GET",
    });
}

export function getmoreComingList() {
    return request({
        url: "index/moreComingList",
        method: "GET",
    });
}

//小视频
export function getshortvideo(offset) {
    return request({
        url: `video/short/${offset}`,
        method: "GET",
    });
}

//地址
export function getcities() {
    return request({
        url: "cities.json",
        method: "GET",
    });
}

export function ChosecloseCinema() {
    //获取筛选条件
    return request({
        url: "index/filterCinemas?ci=295",
        method: "GET",
    });
}

export function getcloseCinema() {
    //获取当前城市附近影院
    return request({
        url: "index/moreCinemas?&offset=0&limit=20&cityId=295&lat=23.53919&lng=110.39215", //当前城市id和经纬度
        method: "GET",
    });
}

export function getcloseCinemaNew(ci, lat, lng) {
    //根据经纬度和城市id获取当前城市附近影院
    return request.get("index/moreCinemas?&offset=0&limit=20", {
        params: {
            cityId: ci, //城市id
            lat: lat, //经度
            lng: lng, //纬度
        },
    });
}

export function getCinemaDeatilByid(id) {
    //获取影院详情
    return request.get("cinema/detail?", {
        params: {
            cinemaId: id,
        },
    });
}

export function getCinemaonshowmovielist(id) {
    //获取当前影院正在上映内容
    return request.get("cinema/shows?", {
        params: {
            cinemaId: id,
            ci: 295,
        },
    });
}

//经典电影
export function getClassicsMovie() {
    return request({
        url: "index/moreClassicList?sortId=1&showType=3&limit=50&offset=0",
        method: "GET",
    });
}

// 电影详情
export function getTadil(id) {
    return request.get("movie/detail", {
        params: {
            movieId: id,
        },
    });
}

//小视频
export function getVideo(id) {
    return request.get("video/" + id);
}